<html class="off">
<head>
<meta charset="utf-8">
<title>权限列表</title>
<link href="__PUBLIC__/css/public.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="content">
	<div class="right_main">
		<div id="J_rframe" class="rframe_b">
			<div class="navigation">
				<div class="content_menu ib_a blue line_x"><a href="{:U('Power/add')}" class="add fb J_showdialog">添加权限</a></div>
			</div>
			<div class="pad_lr_10">
				<div class="J_tablelist table_list">
					<table width="100%" cellspacing="0">
						<thead>
							<tr>
								<th width="5%"><span tdtype="order_by" fieldname="id">ID</span></th>
								<th align="center" width="10%">管理名称</th>
								<th align="center" width="70%">管理权限</th>
								<th width="15%">管理操作</th>
							</tr>
						</thead>
						<tbody>
						<foreach name="data" item="v">
							<tr id="power{$v.id}">
								<td align="center">{$v.id}</td>
								<td align="center">{$v.title}</td>
								<td align="center">
								<foreach name="v['data_content']" item="v2">
								{$v2}&nbsp;&nbsp;|&nbsp;&nbsp;
								</foreach>
								</td>
								<td align="center">
									<a href="{:U('Power/edit',array('id'=>$v['id']))}" class="J_showdialog">编辑</a> 
									|<a href="javascript:del({$v.id})">删除</a>
								</td>
							</tr>
						</foreach>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
</div>
<script src="__PUBLIC__/js/jquery.js" type="text/javascript" charset="utf-8"></script>
<script>
//ajax删除幻灯片
function del(id) {
	if(confirm('你确认要删除基本信息吗?')) {
		$.post("__CONTROLLER__/del",{id:id},function(data){
			if(data == -1) {
				alert('删除只能是ajax方式');
			}else if(data == 0) {
				alert('删除失败,请重新刷新重试');
				location.reload();  //重新加载页面
			}else if(data == 1) {
				$('#power'+id).remove();//直接移除
				window.location.href="__ACTION__";
			}
		})
	}
}
</script>
</body>
</html>